package com.xybbs.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xybbs.entity.Tips;
import com.xybbs.mapper.TipsMapper;
import com.xybbs.service.TipsService;

@Service
@Transactional
public class TipsServiceImpl implements TipsService {

	@Autowired
	TipsMapper tipsMapper;

	public void add(Tips tip) {
		// TODO Auto-generated method stub
		tipsMapper.insert(tip);
	}

	public List<Tips> checkAllWithUser() {
		// TODO Auto-generated method stub
		return tipsMapper.selectAllWithUser();
	}

	public List<Tips> checkTipsByUserId(String userId) {
		// TODO Auto-generated method stub
		return tipsMapper.selectTipsByUserId(userId);
	}

	public Tips checkTipByIdWithUser(String tipId) {
		// TODO Auto-generated method stub
		return tipsMapper.selectTipByIdWithUser(tipId);
	}

	public void updateTipWhenClicked(String tipId) {
		// TODO Auto-generated method stub
		tipsMapper.updateTipClickById(tipId);
	}

	public void updateTipRepliesWhenReplyed(String tipId) {
		tipsMapper.updateTipRepliesById(tipId);
	}

	public void updateTipByIdWhenClicked(String tipId) {
		// TODO Auto-generated method stub
		tipsMapper.updateTipClickById(tipId);
	}

	public void updateTipRepliesWhenRemoveReplyed(String tipId) {
		// TODO Auto-generated method stub
		tipsMapper.updateTipRepliesWhenReove(tipId);
	}

	public void updateTipStatus(String tipId, String code) {
		// TODO Auto-generated method stub
		tipsMapper.updateTipStatus(tipId,code);
	}

	public void updateTipKnow(String tipId, String code) {
		// TODO Auto-generated method stub
		tipsMapper.updateTipKnot(tipId, code);	
	}


}
